<?php
include ('../../configs/cms.php');
include ('../includes/index.php');
include ('../includes/404.php');
include ('../classes/cPhotoAlbum.php');
$photoAlbum = new cPhotoAlbum ();
?>
<div style="margin: 0px; padding: 0px;">
	<?php
	if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset ($_POST ['albumname']))
	{
		if($photoAlbum -> create ($_POST ['albumname']))
		{
			echo 'Album \'' . $_POST ['albumname'] . '\' succesvol aangemaakt.';
		}
		else
		{
			echo 'Sorry, kon \'' . $_POST ['albumname'] . '\' niet aanmaken. Probeer het (later) opnieuw.';
		}
	}
	else
	{
		echo '<form action="" method="post" name="albumcreate">';
		echo '<label>Albumnaam: </label><br /><input autocomplete="autocomplete" autofocus="autofocus" maxlength="255" name="albumname" required="required" size="25 type="text" />';
		echo '<button type="submit">Submit</button>';
		echo '</form>';
	}
	?>
</div>